import { MasterEnum } from '@/enums';
import http from '@/utils/http';

const privilege = {
  //拥有的权限
  getPrivileges(master: MasterEnum, id: number) {
    let url = '/admin/Privilege/GetPrivileges';
    const params = { master, id };
    return http.post(url, params);
  },
  //设置权限
  setPrivilege(master: MasterEnum, id: number, appIds: Array<number>, resourceIds: Array<number>) {
    let url = '/admin/Privilege/SetPrivilege';
    const params = { master, id, appIds, resourceIds };
    return http.post(url, params);
  },
};
export default privilege;
